using System;
using System.Globalization;
using System.Windows.Data;
using ChessKit.Common;

namespace ChessKit.Ui
{
  public class CellColorConverter : IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
      var boardLocation = (BoardLocation) value;
      return (boardLocation.X + boardLocation.Y + 1)%2;
    }

    public object ConvertBack(object value, Type targetTypes, object parameter, CultureInfo culture)
    {
      throw new NotImplementedException();
    }
  }
}